<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>安排教师排课</title>
</head>
<body>

<div th:include="main :: head"></div>


<h2>排课管理</h2>
<hr>


<div style="display: flex;justify-content: space-around">


    <div style="display: flex;justify-content: space-around">
        <table border="1">
            <tr>
                <td align="uid">教师ID</td>
                <td align="uname">教师名称</td>
                <td align="clzno">班级编号</td>
                <td align="clzname">班级名称</td>
                <td align="cno">课程编号</td>
                <td align="cname">课程名称</td>
                <td align="play">操作</td>
            </tr>

            <tr th:each="x:${tasks}">
                <td th:text="${x.user.uid}"></td>
                <td th:text="${x.user.uname}"></td>
                <td th:text="${x.clz.clzno}"></td>
                <td th:text="${x.clz.clzname}"></td>
                <td th:text="${x.course.cno}"></td>
                <td th:text="${x.course.cname}"></td>
                <td><a th:href="'/adm/task/del/'+${x.kid}">删除</a></td>
            </tr>
        </table>
    </div>

    <div style="display: flex;justify-content: space-around">

        <div>
            <button>
                <a href="/adm/task/go2add">添加新的排课-安排某位教师到某班上某课</a>
            </button>
        </div>

        <br>

        <div th:if="${action}=='add'">

            <form th:action="'/adm/task/'+${action}" method="post">
                教师：<select name="user.uid" >
                <option th:each="y:${allTea}"
                        th:text="${y.uname}"
                        th:value="${y.uid}">
                </option>
            </select>

                <br>

                班级：<select name="clz.clzno">
                <option th:each="y:${allClz}"
                        th:text="${y.clzname}"
                        th:value="${y.clzno}">

                </option>
            </select>

                <br>

                课程：<select name="course.cno">
                <option th:each="y:${allCourse}"
                        th:text="${y.cname}"
                        th:value="${y.cno}">
                </option>
            </select>

                <br>

                <input type="submit" th:value="${actmsg}">

            </form>

        </div>


    </div>


</div>




</body>
</html>